﻿namespace Magic.Oidc.ResourceServer.Extensions
{
    public static class RegisterMiddlewares
    {
        public static WebApplication SetupMiddlewares(this WebApplication app)
        {
            app.UseStaticFiles();
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.OAuthClientId("web-client");
                c.OAuthClientSecret("901564A5-E7FE-42CB-B10D-61EF6A8F3654");
            });

            app.UseHttpsRedirection();
            app.UseCors();
            app.UseAuthentication();
            app.UseAuthorization();

            app.MapControllers();
            return app;
        }
    }
}
